package com.hmy.contract.commons.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author seven.qi 齐胜南
 * @version 1.0
 * @description
 * @date 2023/12/25 10:27
 */
@Getter
@AllArgsConstructor
public enum ContractStatusEnum {



    WAITING_SIGN(21, "待签署"),
    SIGNED(22, "已签署"),
    EXPIRED(23, "已过期"),
    WAITING_UPLOAD(24, "待上传"),
    WAITING_APPROVAL(25, "待审批"),
    RISK_MINISTER_APPROVAL(32, "待审批"),
    APPROVED(26, "已通过"),
    REJECT(27, "已驳回"),
    UNSIGNED(28, "未签署"),
    WAITING_CREATE(30, "合同生成中"),
    CONTRACT_CREATE_FAILED(31, "合同生成失败"),
    ;

    private final Integer status;

    private final String statusDesc;

    public static String getDescByStatus(Integer status) {
        for (ContractStatusEnum contractStatusEnum : ContractStatusEnum.values()) {
            if (contractStatusEnum.getStatus().intValue() == status) {
                return contractStatusEnum.getStatusDesc();
            }
        }
        return null;
    }
}
